#ifndef __MOTO_H
#define __MOTO_H

#include "stm32f1xx_hal.h"

typedef enum
{
    OFF = GPIO_PIN_RESET,
    ON = GPIO_PIN_SET
} MOTO_STATE_TYPE;

// #define ON GPIO_PIN_SET
// #define OFF GPIO_PIN_RESET

#define CounterClockWise GPIO_PIN_SET
#define ClockWise GPIO_PIN_RESET
#define Max_Speed_CCR 100
#define Moto_PWM_TIM htim2
#define Moto_PWM_Channel TIM_CHANNEL_1
#define SGM250_PARAMS (11 * 4.4)
#define SGM250_6V_N 22.67
#define SGM250_3V3_N 12.47


void Moto_State(MOTO_STATE_TYPE MOTO_STATE);
void Toggle_Moto_State();
void Moto_Direction(uint8_t MOTO_DIRECTION);
void Toggle_Moto_Direction();
void MotoControl_EXTI_Callback();
void Set_Moto_Speed(int percentage);
void Switch_Moto_Speed(uint16_t ccr);
int16_t Read_MotoSpeed();

#endif